package com.github.phoenics.militia.bazookaFx.model;

import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;


/**
 * @author Phoenics Chow
 * on 2019年01月31日
 */
public class AppTreeModel implements IModel {
    private static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(AppTreeModel.class);
    private StringProperty name=new SimpleStringProperty();
    private String funId="";
    private ObjectProperty<AppLinkModel> appModel=new SimpleObjectProperty<>();
    @Override
    public void clear() {
        setAppModel(null);
        setName(null);
    }

    public String getName() {
        return name.get();
    }

    public StringProperty nameProperty() {
        return name;
    }

    public void setName(String name) {
        this.name.set(name);
    }

    public String getFunId() {
        return funId;
    }

    public void setFunId(String funId) {
        this.funId = funId;
    }

    public AppLinkModel getAppModel() {
        return appModel.get();
    }

    public ObjectProperty<AppLinkModel> appModelProperty() {
        return appModel;
    }

    public void setAppModel(AppLinkModel app) {
        this.appModel.set(app);
    }
    @Override
    public String toString(){
        return getName();
    }
}
